import { http } from '@/utils/http/axios';

//axios
import axios from "../myAxios.js"

//获取数据
import { storage } from '@/utils/Storage';
import { ACCESS_TOKEN, CURRENT_USER, IS_SCREENLOCKED } from '@/store/mutation-types';

import { httpProduction } from '@/utils/http/axios'
import role from 'mock/system/role';
import { tokenToString } from 'typescript';

export interface BasicResponseModel<T = any> {
  code: number;
  message: string;
  result: T;
}

export interface BasicPageParams {
  pageNumber: number;
  pageSize: number;
  total: number;
}

/**
 * @description: 获取用户信息
 */
export function getUserInfo() {
  return http.request({
  
    url: '/user/info',
  
    method: 'get',
  });//通过这个拿权限


  // console.log("api/user/info",params)

  // return axios.post('http://172.20.224.219:8080/api/user/info', params)

}

/**
 * @description: 用户登录 modify httpProduction
 */
export function login(params) {
  
  return axios.post('/user/login', params)

}

/**
 * @description: 用户修改密码
 */
export function changePassword(params, uid) {
  return http.request(
    {
      url: `/user/u${uid}/changepw`,
      method: 'POST',
      params,
    },
    {
      isTransformResponse: false,
    }
  );
}

/**
 * @description: 用户登出
 */
export function logout(params) {
  return http.request({
    url: '/login/logout',
    method: 'POST',
    params,
  });
}
